﻿Public Partial Class admin_grupo_teorico
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btninsertar_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btninsertar.Click
        Try
            Dim cl As New ASI_2UFG_BL.class_admin
            cl.Insertar_Grupo_Teorico("I", dropid_materia.SelectedValue, dropid_personal.SelectedValue, 0)
            If cl.log = 0 Then
                Me.lbmensaje.Text = "Ingresado Con exito"
                GridView1.DataBind()
            Else
                Me.lbmensaje.Text = "Error al ingresar el Registro"
            End If
        Catch ex As Exception
            MsgBox(ex, MsgBoxStyle.Critical)
        End Try
    End Sub
    Protected Sub btnModificar_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnModificar.Click
        Try
            Dim cl As New ASI_2UFG_BL.class_admin
            cl.Modificar_Grupo_Teorico("M", txtid_grupo_teorico.Text, dropid_materia.SelectedValue, dropid_personal.SelectedValue, 0)
            If cl.log = 0 Then
                Me.lbmensaje.Text = "Modificado Con exito"
                GridView1.DataBind()
            Else
                Me.lbmensaje.Text = "Error al Modificar el Registro"
            End If
        Catch ex As Exception
            MsgBox(ex, MsgBoxStyle.Critical)
        End Try
    End Sub

    Protected Sub btnEliminar_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnEliminar.Click
        Try
            Dim cl As New ASI_2UFG_BL.class_admin
            cl.Eliminar_Grupo_Teorico("E", txtid_grupo_teorico.Text, 0)
            If cl.log = 0 Then
                Me.lbmensaje.Text = "Eliminado Con exito"
                GridView1.DataBind()
            Else
                Me.lbmensaje.Text = "Error al Eliminar el Registro"
            End If
        Catch ex As Exception
            MsgBox(ex, MsgBoxStyle.Critical)
        End Try
    End Sub

End Class